package actionScripts.control
{
	import actionScripts.AdminSetupModelLocator;
	import actionScripts.commands.AdminSetupRemoteServiceCalls;
	import actionScripts.events.AdminSetupDataEvent;

	public class AdminSetupController
	{
		//----------------------
		// PRIVATE VARIABLES
		//----------------------
		private var adminRemoteService	:AdminSetupRemoteServiceCalls = new AdminSetupRemoteServiceCalls();
		private var appModelLocator  	:AdminSetupModelLocator = AdminSetupModelLocator.getInstance();
		public function AdminSetupController()
		{
			appModelLocator.addEventListener( AdminSetupDataEvent.CHECK_USERNAME, adminRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( AdminSetupDataEvent.GET_ALL_USERS, adminRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( AdminSetupDataEvent.GET_USERS, adminRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( AdminSetupDataEvent.GET_USER_DETAIL, adminRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( AdminSetupDataEvent.CHECK_USERNAME, adminRemoteService.execute, false, 0, true );
			appModelLocator.addEventListener( AdminSetupDataEvent.UPDATE_USER_DETAIL, adminRemoteService.execute, false, 0, true );
		}
	}
}